<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div :style="{fontSize:msg+'px'}"> {{msg}}</div>
        <sub-a @btn="fn"></sub-a>
    </div>
    <script src="../vue.js"></script>
    <script>
        Vue.component('sub-a', {
            template: `
                <button @click="$emit('btn',5)">点击</button>
            `
        })
        new Vue({
            el: "#app",
            data: {
                msg: 10
            },
            methods: {
                fn(val, event) {
                    this.msg += val;
                    console.log(this.msg);
                    console.log(val);


                }
            }
        })
    </script>
</body>

</html>